package com.swan.web.exception;

import com.swan.web.domain.BaseResponse;
import org.springframework.core.Ordered;

public interface IExceptionHandler extends Ordered {

    /** 处理异常
     * @param throwable
     * @return
     */
    BaseResponse handle(Throwable throwable);

    /** 返回可以处理的异常类型
     * @return
     */
    Class<? extends Throwable> handleType();

    /** 返回http状态码
     * @return
     */
    default int httpStatus() { return 500; };

}
